package com.minivision.fdiot.repository.mysql;

import java.util.Date;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import com.minivision.fdiot.entity.MqttLog;

public interface MqttLogRepository extends JpaRepository<MqttLog, Long> {
  
  Page<MqttLog> findByCreateTimeBetweenOrderByCreateTimeDesc(Date startTime, Date endTime, Pageable pageable);
  
  List<MqttLog> findByDeviceSn(String deviceSn);

  List<MqttLog> findByDeviceSnAndCmdCode(String deviceSn, int cmdCode);
  
}
